package caiziyou.com.designpattern.principle.singleresponbility;

/**
 * 设计模式设计原则之单一职责原则
 * 
 * @author Administrator
 *
 */
public class SingleResponsibility1 {
	public static void main(String[] args) {
		Vehicle vehicle = new Vehicle();
		vehicle.run("自行车");
		vehicle.run("汽车");
		vehicle.run("摩托车");

		vehicle.run("飞机");
	}
}

/**
 * 交通工具
 * 
 * @author Administrator
 *
 */
class Vehicle {
	public void run(String vehicle) {
		System.out.println(vehicle + "在公路上跑。。。");
	}
}